Page({
  data: {
    statusBarHeight: '',
    titleBarHeight: '',
    navHeight: '',
    signOpened: false,
    imgSrc:'https://rhi0.xiyun.net/zhuandian/',
    userId:'',
  },
  onLoad() {
     my.getSystemInfo({
      success: (res) => {
        this.setData({
          'statusBarHeight': res.statusBarHeight,//状态栏高度 
          'titleBarHeight': res.titleBarHeight,//标题栏高度
          'navHeight': res.statusBarHeight + res.titleBarHeight //导航栏高度
         
        })
      }
    });
    let id = my.getStorageSync({key:'userInfo'}).data.id;
    this.setData({
      userId:id,
    })
  },
  signOpened(){
    this.setData({
      signOpened: true,
    });
  },
  onSignClose(){
    this.setData({
      signOpened: false,
    });
  },
  shareSuccess(){
    my.showSharePanel();   
  },
  shareBouns(){
    my.navigateTo({
      url: '/pages/shareBouns/shareBouns'
    });    
  },
  onShareAppMessage () {
    return {
      title: '挣点', // 标题
      desc: '任务多多，天天领取现金红包', // 描述
      path: 'pages/index/index?userid='+this.data.userId, // 分享的小程序页面
      success(res){
        my.navigateTo({
          url: '/pages/shareSuccess/shareSuccess'
        }); 
      },
      fail(res){
        console.log('fail',res)
      },
    }
  },
});
